From 1f30c27a9b8f86a05d0366e6def1949996353005 Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Wed, 16 Jan 2008 15:55:57 +0000 Subject: [PATCH] amd hvm (svm): Print warning if NPT constraints on PAE are hit. Signed-off-by: Keir Fraser --- xen/arch/x86/mm/p2m.c | 9 ++++++++- xen/include/asm-x86/hvm/domain.h | 4 ++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c index 09d376b8a9..cb3e6a066d 100644 --- a/xen/arch/x86/mm/p2m.c +++ b/xen/arch/x86/mm/p2m.c @@ -701,12 +701,19 @@ guest_physmap_add_entry(struct domain *d, unsigned long gfn, return -EINVAL; #if CONFIG_PAGING_LEVELS == 3 - /* 32bit PAE nested paging does not support over 4GB guest due to + /* + * 32bit PAE nested paging does not support over 4GB guest due to * hardware translation limit. This limitation is checked by comparing * gfn with 0xfffffUL. */ if ( paging_mode_hap(d) && (gfn > 0xfffffUL) ) + { + if ( !test_and_set_bool(d->arch.hvm_domain.amd_npt_4gb_warning) ) + dprintk(XENLOG_WARNING, "Dom%d failed to populate memory beyond" + " 4GB: remove 'hap' Xen boot parameter.\n", + d->domain_id); return -EINVAL; + } #endif p2m_lock(d); diff --git a/xen/include/asm-x86/hvm/domain.h b/xen/include/asm-x86/hvm/domain.h index 269f33a7bd..e38384462c 100644 --- a/xen/include/asm-x86/hvm/domain.h +++ b/xen/include/asm-x86/hvm/domain.h @@ -73,6 +73,10 @@ struct hvm_domain { /* Pass-through */ struct hvm_iommu hvm_iommu; + +#if CONFIG_PAGING_LEVELS == 3 + bool_t amd_npt_4gb_warning; +#endif }; #endif /* __ASM_X86_HVM_DOMAIN_H__ */ -- 2.30.2